package edu.sctu.practice.class02.Wangpeng.Assign06.Test3;

/**
 * Created by wp on 2015/11/23.
 */
public class ThreadA extends Thread {
    public int sleeptime;

    public ThreadA(String id){
        super(id);
        sleeptime=(int)(Math.random()*100);
        System.out.println("The Thread name="+getName()+"Sleep:"+sleeptime);
    }
    public void run(){
        try{Thread.sleep(sleeptime);
        }catch (InterruptedException e){
            System.out.println("Exception:"+e.toString());
        }
        System.out.println("The running Thread="+getName());
    }
}
